//
//  Button.swift
//  demo01
//
//  Created by babybus on 2025/6/25.
//
import Foundation
import UIKit

class Button:UIButton{

    override func willRemoveSubview(_ subview: UIView) {
        super.willRemoveSubview(subview)
        print("willRemoveSubview-当子视图从本视图移除时调用")
    }

    override func willMove(toSuperview newSuperview: UIView?) {
        super.willMove(toSuperview: newSuperview)
        print("willMove-当视图即将加入父视图时 / 当视图即将从父视图移除时调用")
    }

    override func didMoveToSuperview() {
        super.didMoveToSuperview()
        print("didMoveToSuperview-当视图加入父视图时 / 当视图从父视图移除时调用")
    }

    override func willMove(toWindow newWindow: UIWindow?) {
        super.willMove(toWindow: newWindow)
        print("willMove-当视图即将加入window视图时 / 当视图即将从window视图移除时调用")
    }

    override func didMoveToWindow() {
        super.didMoveToWindow()
        print("didMoveToWindow-当视图加入window视图时 / 当视图从window视图移除时调用")
    }
    override func didAddSubview(_ subview: UIView) {
        super.didAddSubview(subview)
        print("didAddSubview-当视图添加子视图时调用")
    }
}

